﻿using System.Windows;

namespace Dsl.Ped.Framework.Common
{
    /// <summary>
    /// This is the implementation of the transition, it contains the 
    /// <see cref="Event"/>, name of the source projection and the name of a target projection.
    /// 
    /// <see cref="ProjectionContainer"/> uses the instance of this class to represent internally
    /// the transitions between projections registered in the container.
    /// </summary>
    public class Transition
    {
        /// <summary>
        /// Event that will cause the activation of a transition
        /// </summary>
        public RoutedEvent Event { get; set; }

        /// <summary>
        /// Name of the source projection in the transition
        /// </summary>
        public string SourceProjectionName { get; set; }

        /// <summary>
        /// Name of the target projection in the transition
        /// </summary>
        public string TargetProjectionName { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="Transition"/> class.
        /// </summary>
        /// <param name="e">The event activating the transition</param>
        /// <param name="sourceProjectionName">The source projection name</param>
        /// <param name="targetProjectionName">The target projection name</param>
        public Transition(RoutedEvent e, string sourceProjectionName, string targetProjectionName)
        {
            this.Event = e;
            this.SourceProjectionName = sourceProjectionName;
            this.TargetProjectionName = targetProjectionName;
        }
    }
}
